export default function (){
    
    return new Promise((resolve, reject) => {
        
        wx.showLoading({
            title: '加载中',
            mask: true
          })


        wx.getUserProfile({
            desc: '用于抽奖中人员的显示',
            success: (res) => {

                wx.hideLoading();
              console.log('用户信息授权',res)
              
              const userInfo = res.userInfo;
              if(userInfo){
               
                
                wx.setStorageSync('authorizedInfo', res)
                wx.setStorageSync('userInfo', userInfo)
              
                resolve()
              }
            },
            fail (e) {
                console.log(e)
            },
            complete(){
              wx.hideLoading();
            }
          })
    })
}